feat(generated): update generated SDK from spec changes#242
feat(generated): update generated SDK from spec changes#242workos-sdk-automation[bot] wants to merge 1 commit intomainfrom
Conversation
Greptile SummaryThis auto-generated PR syncs the .NET SDK to OpenAPI spec changes: adds new Confidence Score: 3/5Not safe to merge as-is — EventsService returns an empty EventSchema class, silently dropping all event data for existing consumers. A P1 finding is present: EventSchema was gutted to an empty class while EventsService.ListAsync still returns WorkOSList, making all event payload data inaccessible. The rest of the changes (new services, enum additions, method renames) look correct. src/WorkOS.net/Entities/EventSchema.cs and src/WorkOS.net/Services/Events/EventsService.cs — EventSchema is now empty but EventsService still uses it as the list item type. Important Files Changed
Reviews (1): Last reviewed commit: "fix(generated): update generated SDK fro..." | Re-trigger Greptile |
| public class EventSchema | ||
| { | ||
|
|
||
| /// <summary>Distinguishes the Event object.</summary> | ||
| public string Object { get; internal set; } = "event"; | ||
|
|
||
| /// <summary>Unique identifier for the Event.</summary> | ||
| public string Id { get; set; } = default!; | ||
|
|
||
| /// <summary>The type of event that occurred.</summary> | ||
| public string Event { get; set; } = default!; | ||
|
|
||
| /// <summary>The event payload.</summary> | ||
| public Dictionary<string, object> Data { get; set; } = default!; | ||
|
|
||
| /// <summary>An ISO 8601 timestamp.</summary> | ||
| public DateTimeOffset CreatedAt { get; set; } | ||
|
|
||
| /// <summary>Additional context about the event.</summary> | ||
| public Dictionary<string, object>? Context { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Typed accessor for <see cref="Data"/>. Returns the value stored under | ||
| /// <paramref name="key"/> coerced to <typeparamref name="T"/>, or the default | ||
| /// value when the key is missing or the value is not convertible. | ||
| /// </summary> | ||
| /// <typeparam name="T">Expected value type.</typeparam> | ||
| /// <param name="key">The key to look up.</param> | ||
| public T? GetDataAttribute<T>(string key) | ||
| { | ||
| if (this.Data == null) | ||
| { | ||
| return default; | ||
| } | ||
|
|
||
| if (!this.Data.TryGetValue(key, out var value)) | ||
| { | ||
| return default; | ||
| } | ||
|
|
||
| if (value is T typed) | ||
| { | ||
| return typed; | ||
| } | ||
|
|
||
| if (value is Newtonsoft.Json.Linq.JToken token) | ||
| { | ||
| return token.ToObject<T>(); | ||
| } | ||
|
|
||
| if (value is System.Text.Json.JsonElement element) | ||
| { | ||
| return System.Text.Json.JsonSerializer.Deserialize<T>(element.GetRawText()); | ||
| } | ||
|
|
||
| return default; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Typed accessor for <see cref="Context"/>. Returns the value stored under | ||
| /// <paramref name="key"/> coerced to <typeparamref name="T"/>, or the default | ||
| /// value when the key is missing or the value is not convertible. | ||
| /// </summary> | ||
| /// <typeparam name="T">Expected value type.</typeparam> | ||
| /// <param name="key">The key to look up.</param> | ||
| public T? GetContextAttribute<T>(string key) | ||
| { | ||
| if (this.Context == null) | ||
| { | ||
| return default; | ||
| } | ||
|
|
||
| if (!this.Context.TryGetValue(key, out var value)) | ||
| { | ||
| return default; | ||
| } | ||
|
|
||
| if (value is T typed) | ||
| { | ||
| return typed; | ||
| } | ||
|
|
||
| if (value is Newtonsoft.Json.Linq.JToken token) | ||
| { | ||
| return token.ToObject<T>(); | ||
| } | ||
|
|
||
| if (value is System.Text.Json.JsonElement element) | ||
| { | ||
| return System.Text.Json.JsonSerializer.Deserialize<T>(element.GetRawText()); | ||
| } | ||
|
|
||
| return default; | ||
| } | ||
| } |
There was a problem hiding this comment.
EventSchema gutted — EventsService now returns empty objects
All properties (Id, Event, Data, CreatedAt, Context) and the helper methods GetDataAttribute<T> / GetContextAttribute<T> have been removed, leaving EventSchema as an empty class. EventsService.ListAsync still returns WorkOSList<EventSchema>, so callers receive a list of empty objects with no data accessible at all. Any code consuming event payloads (event type, payload data, timestamps) will break silently at runtime.
|
|
||
| /// <summary>Additional context about the event.</summary> | ||
| public EventSchemaContext Context { get; set; } = default!; | ||
| public FlagCreatedContext Context { get; set; } = default!; |
There was a problem hiding this comment.
Misleading context type on FlagDeleted
FlagDeleted.Context is typed as FlagCreatedContext, which is semantically incorrect for a delete event. If FlagCreated and FlagDeleted share the same context shape, a neutral name such as FlagEventContext would be clearer; alternatively, introduce a separate FlagDeletedContext type.
| "admin_emails": [ | ||
| "admin@example.com" | ||
| ], |
There was a problem hiding this comment.
Stale
admin_emails field in fixture
AdminEmails was removed from GenerateLink and AdminPortalOptions in this PR (renamed to ItContactEmails). The admin_emails key remaining here no longer maps to any property and will be silently ignored during deserialization. Remove it to keep the fixture accurate.
Summary
update generated SDK from spec changes
Spec Diff
Triggered by openapi-spec commit: 9998aeaecba4f3635f8beda2e3248f5a24b7e93f